import Vue from 'vue'
import DialogVue from './index.vue'
//创建构造器
const Dialog = Vue.extend(DialogVue)

DialogVue.install = function (options ={}) {
  //创建实例
  let instance = new Dialog({
    data: options
  })
  instance.makeSureBtn = () => {
    options.makeSure()
    options.show = false
  }
  instance.$mount()
  document.body.appendChild(instance.$el)
  Vue.nextTick(()=>{
    instance.show = true
  })
}
export default  DialogVue;
